package com.rongke.model;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.rongke.utils.DateJsonDeserializer;
import com.rongke.utils.DateJsonSerializer;
import org.jetbrains.annotations.NotNull;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @Goods
 * @商品(goods)
 * @version : Ver 1.0
 */
@TableName("goods")
public class Goods implements Serializable {
	@TableField(exist = false)
	private static final long serialVersionUID = 1L;

	/**
	 * @备注:商品id
	 * @字段:id BIGINT(19)
	 */
	@TableId(type = IdType.AUTO)
	private java.lang.Long id;

	/**
	 * @备注:商品名称
	 * @字段:goods_name VARCHAR(100)
	 */
	private java.lang.String goodsName;

	/**
	 * @备注:商品分类
	 * @字段:classify_id BIGINT(19)
	 */

	private Integer classifyId;

    @TableField(exist = false)
	private Classify classify;
	/**
	 * @备注:蜜哆哆价格
	 * @字段:m_price DECIMAL(10)
	 */
	private java.math.BigDecimal mPrice;

	/**
	 * @备注:其他商场价格
	 * @字段:other_price DECIMAL(10)
	 */
	private java.math.BigDecimal otherPrice;

	/**
	 * @备注:商品主图地址
	 * @字段:goods_url VARCHAR(33)
	 */
	private java.lang.String goodsUrl;

	/**
	 * @备注:哆币返现百分比
	 * @字段:return_rate DOUBLE(10)
	 */

	private java.lang.Double returnRate;

	/**
	 * @备注:雅币返现百分比
	 * @字段:return_rate_y DOUBLE(10)
	 */

	private java.lang.Double returnRatey;

	/**
	 * @备注:主页标签分组id
	 * @字段:index_group_id BIGINT(19)
	 */
	private java.lang.Long indexGroupId;

	/**
	 * @备注:商品品牌
	 * @字段:goods_brand VARCHAR(11)
	 */
	private java.lang.String goodsBrand;

    @TableField(exist = false)
	private List<PropName> propNames;

    /**
     * @备注:商品类型（0 蜜哆哆 1蜜雅阁 2 品牌馆）
     * @字段:goods_type INT(10)
     */
    private java.lang.Integer goodsType;


	/**
	 * @备注:是否只有彩虹会员才能购买（0 体验会员和彩虹会员都可购买 1 彩虹会员才能购买）
	 * @字段:rainbow_only INT(10)
	 */
	private java.lang.Integer rainbowOnly;


	/**
	 * @备注:邮费类型（1 江浙沪包邮 2  满九十九包邮 3  五块钱邮费  4 全国包邮（港澳台地区、西藏、新疆、内蒙古、宁夏、青海等地区除外））
	 * @字段:postage INT(10)
	 */
	private java.lang.Integer postage;

	/**
	 * @备注:邮费增加（超重超大等）
	 * @字段:over_delivery_postage DOUBLE(3)
	 */
	private java.lang.Double overDeliveryPostage;


	/**
	 * @备注:app邮费显示
	 * @字段:gt_one_postage DOUBLE(3)
	 */
	private java.lang.String gtOnePostage;


	/**
	 * 商品状态 1代表只上传未发布 2代表正式发布上架 3 下架 4 抢完了
	 */
    private  java.lang.Integer goodsStatus;

	/**
	 * @备注:创建时间
	 * @字段:gmt_datetime DATETIME(19)
	 */
	@JsonSerialize(using=DateJsonSerializer.class)
	@JsonDeserialize(using=DateJsonDeserializer.class)
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss" )
	private java.util.Date gmtDatetime;

	/**
	 * @备注:更新时间
	 * @字段:upt_datetime DATETIME(19)
	 */
	@JsonSerialize(using=DateJsonSerializer.class)
	@JsonDeserialize(using=DateJsonDeserializer.class)
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss" )
	private java.util.Date uptDatetime;


	@Override
	public boolean equals(Object o) {
		if (this == o) return true;
		if (!(o instanceof Goods)) return false;

		Goods goods = (Goods) o;

		if (id != null ? !id.equals(goods.id) : goods.id != null) return false;
		if (goodsName != null ? !goodsName.equals(goods.goodsName) : goods.goodsName != null) return false;
		if (classifyId != null ? !classifyId.equals(goods.classifyId) : goods.classifyId != null) return false;
		if (mPrice != null ? !mPrice.equals(goods.mPrice) : goods.mPrice != null) return false;
		if (otherPrice != null ? !otherPrice.equals(goods.otherPrice) : goods.otherPrice != null) return false;
		if (goodsUrl != null ? !goodsUrl.equals(goods.goodsUrl) : goods.goodsUrl != null) return false;
		if (returnRate != null ? !returnRate.equals(goods.returnRate) : goods.returnRate != null) return false;
		if (returnRatey != null ? !returnRatey.equals(goods.returnRatey) : goods.returnRatey != null) return false;
		if (indexGroupId != null ? !indexGroupId.equals(goods.indexGroupId) : goods.indexGroupId != null) return false;
		if (goodsBrand != null ? !goodsBrand.equals(goods.goodsBrand) : goods.goodsBrand != null) return false;
		if (propNames != null ? !propNames.equals(goods.propNames) : goods.propNames != null) return false;
		if (goodsType != null ? !goodsType.equals(goods.goodsType) : goods.goodsType != null) return false;
		if (rainbowOnly != null ? !rainbowOnly.equals(goods.rainbowOnly) : goods.rainbowOnly != null) return false;
		if (postage != null ? !postage.equals(goods.postage) : goods.postage != null) return false;
		return goodsStatus != null ? goodsStatus.equals(goods.goodsStatus) : goods.goodsStatus == null;

	}

	@Override
	public int hashCode() {
		int result = id != null ? id.hashCode() : 0;
		result = 31 * result + (goodsName != null ? goodsName.hashCode() : 0);
		result = 31 * result + (classifyId != null ? classifyId.hashCode() : 0);
		result = 31 * result + (mPrice != null ? mPrice.hashCode() : 0);
		result = 31 * result + (otherPrice != null ? otherPrice.hashCode() : 0);
		result = 31 * result + (goodsUrl != null ? goodsUrl.hashCode() : 0);
		result = 31 * result + (returnRate != null ? returnRate.hashCode() : 0);
		result = 31 * result + (returnRatey != null ? returnRatey.hashCode() : 0);
		result = 31 * result + (indexGroupId != null ? indexGroupId.hashCode() : 0);
		result = 31 * result + (goodsBrand != null ? goodsBrand.hashCode() : 0);
		result = 31 * result + (propNames != null ? propNames.hashCode() : 0);
		result = 31 * result + (goodsType != null ? goodsType.hashCode() : 0);
		result = 31 * result + (rainbowOnly != null ? rainbowOnly.hashCode() : 0);
		result = 31 * result + (postage != null ? postage.hashCode() : 0);
		result = 31 * result + (goodsStatus != null ? goodsStatus.hashCode() : 0);
		return result;
	}

	public Goods(){
	}

	public Goods(
		java.lang.Long id
	){
		this.id = id;
	}

	public Integer getGoodsType() {
		return goodsType;
	}

	public Classify getClassify() {
		return classify;
	}

	public void setClassify(Classify classify) {
		this.classify = classify;
	}

	public List<PropName> getPropNames() {
		return propNames;
	}

	public void setPropNames(List<PropName> propNames) {
		this.propNames = propNames;
	}

	public void setGoodsType(Integer goodsType) {
		this.goodsType = goodsType;
	}

	public void setId(java.lang.Long id) {
		this.id = id;
	}

	public java.lang.Long getId() {
		return this.id;
	}

	public Integer getRainbowOnly() {
		return rainbowOnly;
	}

	public Integer getGoodsStatus() {
		return goodsStatus;
	}

	public void setGoodsStatus(Integer goodsStatus) {
		this.goodsStatus = goodsStatus;
	}

	public void setRainbowOnly(Integer rainbowOnly) {
		this.rainbowOnly = rainbowOnly;
	}

	public Integer getPostage() {
		return postage;
	}

	public void setPostage(Integer postage) {
		this.postage = postage;
	}

	public void setGoodsName(java.lang.String goodsName) {
		this.goodsName = goodsName;
	}

	public java.lang.String getGoodsName() {
		return this.goodsName;
	}

	public Integer getClassifyId() {
		return classifyId;
	}

	public void setClassifyId(Integer classifyId) {
		this.classifyId = classifyId;
	}

	public BigDecimal getmPrice() {
		return mPrice;
	}

	public void setmPrice(BigDecimal mPrice) {
		this.mPrice = mPrice;
	}

	public void setOtherPrice(java.math.BigDecimal otherPrice) {
		this.otherPrice = otherPrice;
	}

	public java.math.BigDecimal getOtherPrice() {
		return this.otherPrice;
	}


	public void setGoodsUrl(java.lang.String goodsUrl) {
		this.goodsUrl = goodsUrl;
	}

	public java.lang.String getGoodsUrl() {
		return this.goodsUrl;
	}


	public void setReturnRate(java.lang.Double returnRate) {
		this.returnRate = returnRate;
	}

	public java.lang.Double getReturnRate() {
		return this.returnRate;
	}

	public Double getReturnRatey() {
		return returnRatey;
	}

	public void setReturnRatey(Double returnRatey) {
		this.returnRatey = returnRatey;
	}

	public Long getIndexGroupId() {
		return indexGroupId;
	}

	public void setIndexGroupId(Long indexGroupId) {
		this.indexGroupId = indexGroupId;
	}

	public void setGoodsBrand(java.lang.String goodsBrand) {
		this.goodsBrand = goodsBrand;
	}

	public java.lang.String getGoodsBrand() {
		return this.goodsBrand;
	}

	public Date getGmtDatetime() {
		return gmtDatetime;
	}

	public void setGmtDatetime(Date gmtDatetime) {
		this.gmtDatetime = gmtDatetime;
	}

	public Date getUptDatetime() {
		return uptDatetime;
	}

	public void setUptDatetime(Date uptDatetime) {
		this.uptDatetime = uptDatetime;
	}

	public Double getOverDeliveryPostage() {
		return overDeliveryPostage;
	}

	public void setOverDeliveryPostage(Double overDeliveryPostage) {
		this.overDeliveryPostage = overDeliveryPostage;
	}

	public String getGtOnePostage() {
		return gtOnePostage;
	}

	public void setGtOnePostage(String gtOnePostage) {
		this.gtOnePostage = gtOnePostage;
	}
}
